<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      console.log("start");
      console.log(typeof null); // 输出 "object"
      console.log(Object.prototype.toString.call(null)); // 输出 "[object Null]"
      console.log(typeof undefined); // 输出 "undefined"
      console.log(Object.prototype.toString.call(undefined)); // 输出 "[object Undefined]"
      console.log("end");
      let u = undefined;
      let n = null;
      let s = "hello";
      let obj = { a: 1 };

//       你可以利用 JavaScript 的 Object() 函数来判断一个值是否为基本类型：
// Object(primitive) 会返回一个对应的包装对象；
// 而引用类型本身会直接返回它自己
      console.log(Object(u)); // Throws TypeError
      console.log(u);
      console.log(Object(n)); // {} (空对象)
      console.log(n);
      console.log(Object(s)); // [String: 'hello']
      console.log(s);
      console.log(Object(obj) === obj); // true ✅
      console.log(obj);
    </script>
  </body>
</html>
